<?php
namespace Partner\Brands\Block;

use \Magento\Framework\View\Element\Template;

class Brands extends Template
{
  public function _prepareLayout()
  {
    // echo "这是block文件返回的函数";
  }
  /**
   * 查询品牌数据
   */
  public function getBrandsList()
  {
    // 数据查询管理器
    $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
    // 获取collection对象
    $collection = $objectManager->get('Partner\Brands\Model\ResourceModel\Brands\Collection');

    foreach($collection as $item) {
      echo "<pre>";
      print_r($item->getData());
      echo "</pre>";
    }
  }
}

